home *** CD-ROM | disk | FTP | other *** search
- curhealth = 100;
- totalhealth = 100;
- curmanna = 100;
- totalmanna = 100;
- curdefendhealth = 100;
- totaldefendhealth = 100;
- up = 0;
- numenemies = random(10) + 10;
- deadenemies = 0;
- totalenemies = numenemies;
- level1 = 1;
- level2 = 1;
- level3 = 1;
- level4 = 1;
- level5 = 1;
- level6 = 1;
- time = 250 - up;
- ii = 10000000;
- pp = 99999999;
- z = 100000;
- s = 10000;
- ss = 1000;
- delay = 10;
- points = 500;
- levelon = 1;
- spin = false;
- bomb = false;
- wall = true;
- gunlevel = 1;
- sendinglevel = 1;
- paus = false;
- gameover = false;
- won = false;
- menue = true;
- playgame = false;
- about = false;
- instructions = false;
- inst = 1;
- loadd = false;
- intro = false;
- attachMovie("border","border" + pp,pp);
- _root["border" + pp]._x = 0;
- _root["border" + pp]._y = 0;
- _root["border" + pp]._xscale = 153;
- _root["border" + pp]._yscale = 160;
- _root["border" + pp]._alpha = 0;
- _root["border" + pp].onEnterFrame = function()
- {
- if(this._alpha < 100)
- {
- this._alpha += 3;
- }
- };
- onEnterFrame = function()
- {
- if(levelon == 10)
- {
- dragonlev = true;
- }
- else
- {
- dragonlev = false;
- }
- if(levelon == 15)
- {
- shadelev = true;
- }
- else
- {
- shadelev = false;
- }
- if(levelon == 5)
- {
- bosslevel = 1;
- }
- else if(levelon == 10)
- {
- bosslevel = 2;
- }
- else if(levelon == 15)
- {
- bosslevel = 3;
- }
- else if(levelon == 20)
- {
- bosslevel = 4;
- }
- else
- {
- bosslevel = 2;
- }
- cost1 = level1 * 500;
- cost2 = level2 * 750;
- cost3 = level3 * 500;
- cost4 = level4 * 750;
- cost5 = level5 * 750;
- cost6 = level6 * 750;
- enemiesleft = numenemies - deadenemies;
- if(curdefendhealth < 1 or curhealth < 1)
- {
- gameover = true;
- paus = true;
- won = false;
- }
- timeremaining--;
- if(deadenemies == numenemies or gameover)
- {
- paus = true;
- }
- else
- {
- paus = false;
- }
- if(levelon > 20)
- {
- gameover = true;
- won = true;
- }
- damage = 0.25 * gunlevel + 0.75;
- if(!menue)
- {
- if(!about)
- {
- if(!instructions)
- {
- back.onPress = function()
- {
- if(curmanna > 1 && !paus && !Key.isDown(65))
- {
- z++;
- attachMovie("firespeerb","firespeerb" + z,z);
- curmanna -= 1;
- _root["firespeerb" + z].low = ss - 30;
- _root["firespeerb" + z].high = ss + 30;
- _root["firespeerb" + z].stopped = false;
- _root["firespeerb" + z].xplus = xplus;
- _root["firespeerb" + z].yplus = yplus;
- _root["firespeerb" + z].explode = false;
- _root["firespeerb" + z]._rotation = _root.gun._rotation;
- _root["firespeerb" + z].gotoAndStop(1);
- _root["firespeerb" + z]._x = _root.gun._x + xSpacer;
- _root["firespeerb" + z]._y = _root.gun._y - ySpacer;
- _root["firespeerb" + z]._xscale = 20;
- _root["firespeerb" + z]._yscale = 20;
- _root["firespeerb" + z].onEnterFrame = function()
- {
- this.h = this.low;
- while(this.h < this.high)
- {
- if(_root["shadowhand" + this.h].hitTest(this) or _root["shadowdragon" + this.h].hitTest(this) or _root["mord" + this.h].hitTest(this))
- {
- this.explode = true;
- this.stopped = true;
- }
- this.h = this.h + 1;
- }
- if(this.explode && gunlevel == 1)
- {
- this.gotoAndStop(2);
- this._alpha -= 10;
- }
- else if(this.explode && gunlevel == 2)
- {
- this.gotoAndStop(2);
- this._alpha -= 10;
- }
- else if(this.explode && gunlevel == 3)
- {
- this.gotoAndStop(3);
- this._alpha -= 10;
- }
- else if(this.explode && gunlevel == 4)
- {
- this.gotoAndStop(4);
- this._alpha -= 10;
- }
- else if(this.explode && gunlevel == 5)
- {
- this.gotoAndStop(5);
- this._alpha -= 10;
- }
- else if(this.explode && gunlevel == 6)
- {
- this.gotoAndStop(6);
- this._alpha -= 10;
- }
- else if(this.explode && gunlevel == 7)
- {
- this.gotoAndStop(7);
- this._alpha -= 10;
- }
- else if(paus)
- {
- this._alpha -= 30;
- }
- if(!this.stopped)
- {
- this._x += this.xplus;
- this._y -= this.yplus;
- }
- if(!_root.back.hitTest(this._x - xSpacer,this._y + ySpacer,true) or _root.bars.hitTest(this._x + xSpacer,this._y - ySpacer,true) or this._alpha < 10)
- {
- this.removeMovieClip();
- }
- };
- }
- };
- delay2 = random(time);
- if(totalenemies < 2 && !paus && levelon == 5 && totalenemies > 0 or delay2 < 2 && !paus && levelon == 20 && totalenemies > 0)
- {
- totalenemies--;
- ss++;
- attachMovie("shadowdragon","shadowdragon" + ss,ss);
- _root["shadowdragon" + ss]._xscale = 40;
- _root["shadowdragon" + ss]._yscale = 40;
- _root["shadowdragon" + ss]._rotation = 180;
- _root["shadowdragon" + ss].life = 300;
- _root["shadowdragon" + ss].gotoAndStop(1);
- _root["shadowdragon" + ss]._x = 250;
- _root["shadowdragon" + ss]._y = -100;
- _root["shadowdragon" + ss].dying = false;
- _root["shadowdragon" + ss].stopped = false;
- _root["shadowdragon" + ss].low = _root.z - 30;
- _root["shadowdragon" + ss].high = _root.z + 50;
- _root["shadowdragon" + ss].low2 = _root.s - 15;
- _root["shadowdragon" + ss].high2 = _root.s + 15;
- _root["shadowdragon" + ss].onEnterFrame = function()
- {
- if(!this.stopped)
- {
- this._y += 2;
- this.gotoAndStop(1);
- }
- this.i = this.low;
- while(this.i < this.high)
- {
- if(_root["firespeerb" + this.i].hitTest(this))
- {
- this.life -= damage;
- }
- this.i = this.i + 1;
- }
- this.h = this.low2;
- while(this.h < this.high2)
- {
- if(_root["spinsending" + this.h].hitTest(this) && sendinglevel > 2)
- {
- this.gotoAndStop(3);
- this.life -= 15;
- }
- this.h = this.h + 1;
- }
- if(this.life < 0 or paus)
- {
- this.dying = true;
- }
- if(this.dying && !paus)
- {
- this._alpha -= 3;
- this.stopped = true;
- this.gotoAndStop(3);
- points += 10;
- }
- else if(this.dying && paus)
- {
- this._alpha -= 10;
- }
- if(_root.two.hitTest(this) && !this.dying)
- {
- curhealth -= 0.1;
- this.stopped = true;
- this.gotoAndStop(2);
- }
- if(this._alpha < 0)
- {
- this.removeMovieClip();
- deadenemies++;
- }
- };
- }
- if(delay2 == 7 && !paus && levelon > 6 && totalenemies > 0 or delay2 > 10 && delay2 < 16 && !paus && dragonlev && totalenemies > 0)
- {
- ss++;
- totalenemies--;
- attachMovie("shadowdragon","shadowdragon" + ss,ss);
- _root["shadowdragon" + ss]._xscale = 20;
- _root["shadowdragon" + ss]._yscale = 20;
- _root["shadowdragon" + ss]._rotation = 180;
- _root["shadowdragon" + ss].life = 60;
- _root["shadowdragon" + ss].gotoAndStop(1);
- _root["shadowdragon" + ss]._x = random(300) + 100;
- _root["shadowdragon" + ss]._y = -100;
- _root["shadowdragon" + ss].dying = false;
- _root["shadowdragon" + ss].stopped = false;
- _root["shadowdragon" + ss].low = _root.z - 30;
- _root["shadowdragon" + ss].high = _root.z + 50;
- _root["shadowdragon" + ss].low2 = _root.s - 15;
- _root["shadowdragon" + ss].high2 = _root.s + 15;
- _root["shadowdragon" + ss].onEnterFrame = function()
- {
- if(!this.stopped)
- {
- this._y += 6;
- this.gotoAndStop(1);
- }
- this.i = this.low;
- while(this.i < this.high)
- {
- if(_root["firespeerb" + this.i].hitTest(this))
- {
- this.life -= damage;
- }
- this.i = this.i + 1;
- }
- this.h = this.low2;
- while(this.h < this.high2)
- {
- if(_root["spinsending" + this.h].hitTest(this) && sendinglevel > 2)
- {
- this.gotoAndStop(3);
- this.dying = true;
- }
- else if(_root["spinsending" + this.h].hitTest(this) && sendinglevel < 3)
- {
- this.life -= 2;
- }
- this.h = this.h + 1;
- }
- if(this.life < 0 or paus)
- {
- this.dying = true;
- }
- if(this.dying && !paus)
- {
- this._alpha -= 3;
- this.stopped = true;
- this.gotoAndStop(3);
- points += 3;
- }
- else if(this.dying && paus)
- {
- this._alpha -= 10;
- }
- if(_root.two.hitTest(this) && !this.dying)
- {
- curhealth -= 0.2;
- this.stopped = true;
- this.gotoAndStop(2);
- }
- if(this._y > 600)
- {
- curdefendhealth -= 15;
- this.removeMovieClip();
- deadenemies++;
- }
- if(this._alpha < 0)
- {
- this.removeMovieClip();
- deadenemies++;
- }
- };
- }
- if(delay2 < 4 && !paus && delay2 > 0 && !paus && numenemies > 0 && totalenemies > 0 && !dragonlev)
- {
- ss++;
- totalenemies--;
- attachMovie("shadowhand","shadowhand" + ss,ss);
- _root["shadowhand" + ss]._xscale = 20;
- _root["shadowhand" + ss]._yscale = 20;
- _root["shadowhand" + ss]._rotation = 180;
- _root["shadowhand" + ss].gotoAndStop(1);
- _root["shadowhand" + ss]._x = random(400) + 50;
- _root["shadowhand" + ss]._y = -100;
- if(!shadelev)
- {
- _root["shadowhand" + ss].life = 8;
- }
- else if(shadelev)
- {
- _root["shadowhand" + ss].life = 80;
- }
- _root["shadowhand" + ss].dying = false;
- _root["shadowhand" + ss].stopped = false;
- _root["shadowhand" + ss].low = _root.z - 30;
- _root["shadowhand" + ss].high = _root.z + 50;
- _root["shadowhand" + ss].low2 = _root.s - 15;
- _root["shadowhand" + ss].high2 = _root.s + 15;
- _root["shadowhand" + ss].onEnterFrame = function()
- {
- if(!this.stopped)
- {
- this._y += 4;
- this.gotoAndStop(1);
- }
- this.i = this.low;
- while(this.i < this.high)
- {
- if(_root["firespeerb" + this.i].hitTest(this))
- {
- this.gotoAndStop(3);
- this.life -= damage;
- }
- this.i = this.i + 1;
- }
- this.h = this.low2;
- while(this.h < this.high2)
- {
- if(_root["spinsending" + this.h].hitTest(this))
- {
- this.gotoAndStop(3);
- this.dying = true;
- }
- this.h = this.h + 1;
- }
- if(paus or this.life < 0)
- {
- this.dying = true;
- }
- if(this.dying && !paus)
- {
- this._alpha -= 3;
- this.stopped = true;
- points += 1;
- }
- else if(this.dying && paus)
- {
- this._alpha -= 10;
- }
- if(_root.tower.hitTest(this) && !this.dying)
- {
- curhealth -= 0.05;
- this.stopped = true;
- this.gotoAndStop(2);
- }
- if(this._y > 600)
- {
- curdefendhealth -= 5;
- this.removeMovieClip();
- deadenemies++;
- }
- if(this._alpha < 0)
- {
- this.removeMovieClip();
- deadenemies++;
- }
- };
- }
- delay2 = random(time);
- if(delay2 == 5 && !paus && levelon > 2 && numenemies > 0 && totalenemies > 0 && !dragonlev or delay2 == 6 && !paus && levelon > 4 && numenemies > 0 && totalenemies > 0 && !dragonlev)
- {
- ss++;
- totalenemies--;
- attachMovie("mord","mord" + ss,ss);
- _root["mord" + ss]._xscale = 20;
- _root["mord" + ss]._yscale = 20;
- _root["mord" + ss]._rotation = 180;
- _root["mord" + ss].life = 40;
- _root["mord" + ss].gotoAndStop(1);
- _root["mord" + ss]._x = random(400) + 50;
- _root["mord" + ss]._y = -100;
- _root["mord" + ss].dying = false;
- _root["mord" + ss].stopped = false;
- _root["mord" + ss].low = _root.z - 30;
- _root["mord" + ss].high = _root.z + 50;
- _root["mord" + ss].low2 = _root.s - 15;
- _root["mord" + ss].high2 = _root.s + 15;
- _root["mord" + ss].onEnterFrame = function()
- {
- if(!this.stopped)
- {
- this._y += 3;
- this.gotoAndStop(1);
- }
- this.i = this.low;
- while(this.i < this.high)
- {
- if(_root["firespeerb" + this.i].hitTest(this))
- {
- this.life -= damage;
- }
- this.i = this.i + 1;
- }
- this.h = this.low2;
- while(this.h < this.high2)
- {
- if(_root["spinsending" + this.h].hitTest(this) && sendinglevel > 1)
- {
- this.gotoAndStop(3);
- this.dying = true;
- }
- else if(_root["spinsending" + this.h].hitTest(this) && sendinglevel < 2)
- {
- this.life -= 2;
- }
- this.h = this.h + 1;
- }
- if(this.life < 0 or paus)
- {
- this.dying = true;
- }
- if(this.dying && !paus)
- {
- this._alpha -= 3;
- this.stopped = true;
- this.gotoAndStop(3);
- points += 2;
- }
- else if(this.dying && paus)
- {
- this._alpha -= 10;
- }
- if(_root.one.hitTest(this) && !this.dying)
- {
- curhealth -= 0.15;
- this.stopped = true;
- this.gotoAndStop(2);
- }
- if(this._y > 600)
- {
- curdefendhealth -= 10;
- this.removeMovieClip();
- deadenemies++;
- }
- if(this._alpha < 0)
- {
- this.removeMovieClip();
- deadenemies++;
- }
- };
- }
- if(Key.isDown(65) && delay < -5 && curmanna > 10 && !paus)
- {
- s++;
- delay = 5;
- curmanna -= 10;
- attachMovie("spinsending","spinsending" + s,s);
- _root["spinsending" + s]._alpha = 4;
- _root["spinsending" + s]._xscale = 40;
- _root["spinsending" + s]._yscale = 40;
- _root["spinsending" + s]._y = 300;
- _root["spinsending" + s]._x = _xmouse;
- _root["spinsending" + s].attack = false;
- _root["spinsending" + s].stopped = false;
- _root["spinsending" + s].delay = 200;
- if(sendinglevel == 3)
- {
- _root["spinsending" + s].delay2 = 20;
- }
- else
- {
- _root["spinsending" + s].delay2 = 3;
- }
- _root["spinsending" + s].low = ss - 30;
- _root["spinsending" + s].high = ss + 30;
- _root["spinsending" + s].onEnterFrame = function()
- {
- this.h = this.low;
- while(this.h < this.high)
- {
- if(_root["shadowhand" + this.h].hitTest(this) or _root["shadowdragon" + this.h].hitTest(this) or _root["mord" + this.h].hitTest(this))
- {
- this.attack = true;
- this.stopped = true;
- }
- this.h = this.h + 1;
- }
- if(this.stopped or paus)
- {
- this.delay -= 75;
- }
- this.delay = this.delay - 1;
- if(this._alpha < 100 && !this.attack)
- {
- this._alpha += 2;
- this.gotoAndStop(1);
- }
- if(!this.attack && this._alpha > 98 && !stopped)
- {
- this.gotoAndStop(2);
- this._y -= 2;
- }
- if(this.attack && this._alpha > 30 && sendinglevel == 1)
- {
- this.gotoAndStop(3);
- this._rotation += 30;
- }
- else if(this.attack && this._alpha > 30 && sendinglevel == 2)
- {
- this.gotoAndStop(4);
- }
- else if(this.attack && this._alpha > 30 && sendinglevel == 3)
- {
- this.gotoAndStop(5);
- }
- if(this.delay < 0)
- {
- this.delay2 = this.delay2 - 1;
- if(this.delay2 < 0)
- {
- this._alpha -= 10;
- }
- }
- if(!_root.back.hitTest(this._x,this._y,true) or this._alpha < 2)
- {
- this.removeMovieClip();
- }
- };
- }
- }
- }
- }
- if(curmanna < 20)
- {
- recharge = 0.05;
- }
- else
- {
- recharge = 0.1;
- }
- delay--;
- delay2--;
- xplus = _root.gun.xSpeed;
- yplus = _root.gun.ySpeed;
- xSpacer = 5 * xplus;
- ySpacer = 5 * yplus;
- curmanna += recharge;
- if(curdefendhealth < 0)
- {
- curdefendhealth = 0;
- }
- if(curdefendhealth > totaldefendhealth)
- {
- curdefendhealth = totaldefendhealth;
- }
- perdefendhealth = curdefendhealth / totaldefendhealth * 100;
- if(curhealth < 0)
- {
- curhealth = 0;
- }
- if(curhealth > totalhealth)
- {
- curhealth = totalhealth;
- }
- perhealth = curhealth / totalhealth * 100;
- if(curmanna < 0)
- {
- curmanna = 0;
- }
- if(curmanna > totalmanna)
- {
- curmanna = totalmanna;
- }
- permanna = curmanna / totalmanna * 100;
- if(loadd)
- {
- if(intro)
- {
- if(menue)
- {
- gotoAndStop(4);
- }
- else if(!menue && playgame)
- {
- if(paus && !gameover)
- {
- gotoAndStop(6);
- }
- else if(!paus && !gameover)
- {
- gotoAndStop(5);
- }
- else if(gameover && won)
- {
- gotoAndStop(8);
- }
- else if(gameover && !won)
- {
- gotoAndStop(7);
- }
- }
- else if(!menue && instructions)
- {
- gotoAndStop(8 + inst);
- }
- else if(!menue && about)
- {
- null;
- }
- }
- else if(!intro)
- {
- gotoAndStop(3);
- }
- }
- else if(!loadd)
- {
- gotoAndStop(2);
- }
- };
-